<?php
namespace app\admin\model;
use think\Model;

class Pancha extends model{
	// 盘差
	function findall(){
		$res = db("pancha")->select();
		return $res;
	}
	function findandicap($id,$n){
		if($n==1){
			$px = model('pancha')->where(['id'=>$id])->find();
			return $px['andicapB'];
		}else if($n==2){
			$px = model('pancha')->where(['id'=>$id])->find();
			return $px['andicapC'];
		}else if($n==3){
			$px = model('pancha')->where(['id'=>$id])->find();
			return $px['andicapD'];
		}else{
			return 0;
		}
	}
}